import random

ls = []
for i in range(0, 5):
    ls.append(random.randint(-100, 1000))

for i in range(0, len(ls)):
    for j in range(0, len(ls) - 1 - i):
        if ls[j] > ls[j + 1]:
            tmp = ls[j + 1]
            ls[j + 1] = ls[j]
            ls[j] = tmp
            print(ls)

print("=" * 100)

for i in range(0, len(ls)):
    for j in range(0, len(ls) - 1 - i):
        if ls[j] < ls[j + 1]:
            tmp = ls[j + 1]
            ls[j + 1] = ls[j]
            ls[j] = tmp
            print(ls)
